<?php

class SC_View_Helper_CmsSelect extends Zend_View_Helper_Abstract
{

    public function cmsSelect($name, $value = null, $options, $attribs = array())
    {
        $strAttribs = '';
        if (count($attribs) > 0) {
            foreach ($attribs as $keyAttribs => $valueAttribs) {
                $strAttribs .= $keyAttribs . '="' . $valueAttribs . '" ';
            }
        }

        $xhtml = '<select name="' . $name . '" id="' . $name . '" ' . $strAttribs . ' >';

//		foreach ($options as $key=> $info){
//			$strSelect = '';
//			if($info['id'] == $value){
//				$strSelect = 'selected="selected"';
//			}

//        for ($i = 0; $i < count($options); $i++) {
//            $strSelect = '';
//            if ($options[$i]['id'] == $value)
//                $strSelect = 'selected="selected"';
//
////			if($info['level'] == 1){
////				$xhtml .= '<option value="' . $info['id'] . '" ' . $strSelect . '>+' . $info['title'] . '</option>';
////			}else{
////				$string = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
////				$newString = '';
////				for($i=1;$i<$info['level']; $i++){
////					$newString .= $string;
////				}
////				$info['name'] = $newString . '-' . $info['name'];
////				$xhtml .= '<option value="' . $info['id'] . '" ' . $strSelect . '>' . $info['name'] . '</option>';
////			}
//        }

        $xhtml .= '</select>';

        return $xhtml;
    }

}